import django, os
os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'AvCarrier.settings.develop')
django.setup()

from moviepy.editor import *
from django.conf import settings
import os
from av_editor.models import MaterialFile

m = MaterialFile.objects.get(id=21)
filename = os.path.join(settings.BASE_DIR, m.file.path)
video = VideoFileClip(filename=filename)
video.save_frame("lx.png",t=20)